package com.shangxian.giveithome.mapper.utils;

import java.util.List;

public class More {
    public String more(List<Long> imgIds){
        String url = "";
        url = admin("select any_value(id) as id,key_id, any_value(path) as path from img where key_id IN ",imgIds);
        System.out.println(url);
        return url;
    }
    public String admin(String pictureURL,List<Long> someID){
        StringBuilder URL = new StringBuilder();
        URL.append(pictureURL);
        URL.append("(");

        for (int i = 0; i < someID.size(); i++) {
            URL.append(someID.get(i));
            if (i < someID.size() - 1) {
                URL.append(",");
            }
        }
        URL.append(")");
        URL.append(" GROUP BY key_id");
        return URL.toString();
    }

}
